﻿@model List<ProductDetailsModel.ProductVariantModel>
@using Nop.Core.Domain.Orders;
@using Nop.Web.Models.Catalog;

<h3>Open-Box Deals</h3>
@if (Model.Count > 0)
{
    var i = 1;
    <table>
        <thead>
            <tr>
                <th>#</th>
                <th>Open-Box Product</th>
                <th></th>
                <th>Add</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var productVariant in Model)
            {
                <tr>
                    <td>@i</td>
                    <td><img src="@productVariant.PictureModel.ImageUrl" /></td>
                    <td><h4>@productVariant.Name</h4><p>@productVariant.Description @T("Products.Details.AvailableQuantity") @productVariant.StockQuantity</p> <p>@productVariant.ProductVariantPrice.Price</p></td>
                    <td><form><a class="btn btn-danger add-to-cart" href="javascript:void(0)" onclick="AjaxCart.addproductvarianttocart('@Url.RouteUrl("AddProductVariantToCart", new { productVariantId = productVariant.Id, shoppingCartTypeId = (int)ShoppingCartType.ShoppingCart })', $(this).closest('form'), $(this));return false;"><i class="fa fa-shopping-cart"></i>&nbsp;&nbsp;<span> @T("ShoppingCart.AddToCart"))</span></a></form></td>
                </tr>
                i++;
            }
        </tbody>

    </table>
}